package com.itdct.onflow.core.vo

import com.itdct.onflow.core.constant.CommonString
import io.swagger.v3.oas.annotations.media.Schema
import java.io.Serializable


/**
 * @author DCTANT
 * @version 1.0
 * @date 2021/10/14 17:40:38
 * @description 统一返回类型
 * 注意！统一返回类型千万不要加上@Schema注解！
 */
open class RespVo<T> : Serializable {
    @Schema(title = "返回码code", example = "200")
    var code: Int = 0

    @Schema(title = "返回数据data")
    var data: T? = null

    @Schema(title = "返回提示语info", example = CommonString.SUCCESS)
    var info: String? = null

    constructor(code: Int, data: T?, info: String?) {
        this.code = code
        this.data = data
        this.info = info
    }

    constructor(code: Int, info: String?) {
        this.code = code
        this.info = info
    }

    constructor()
}
